<template>
  <Person ref="ren" />
  <button @click="test">测试</button>
</template>


<script lang="ts">
export default {
  name: 'App',
}


</script>

<!-- 父组件 -->
<script lang="ts" setup>
import Person from './components/Person.vue';

import { ref, defineExpose } from 'vue'

const ren = ref()


function test() {
  console.log(ren.value)
  console.log(ren.value.age)
  console.log(ren.value.name)
}



</script>

<style>
.app {
  background-color: #ddd;
  box-shadow: 0 0 10px;
  border-radius: 10px;
  padding: 20px;
}

button {
  padding: 10px;
  margin: 0 5px;
}
</style>